//
//  CS_Page_RadioView.h
//  Pods
//
//  Created by 网新中研 on 2017/7/18.
//
//

#import <CSUIKit/CSUIKit.h>

/**
 * 视图类型
 */
typedef enum : NSUInteger {
    
    //页面视图类型
    CSRadioViewType_Checked = 1,
    CSRadioViewType_UnChecked = 2,
    
} CSRadioViewType;

typedef void(^RadioButtonClick)(NSInteger selectIndex);
typedef void(^RadioSelectableButtonClick)(CSSelectableModel *selectableModel);

@interface CS_Radio_ItemView : CSBaseView

@property (nonatomic, strong) UIImage *selectedImage;

@property (nonatomic, strong) UIImage *unSelectedImage;

@property (nonatomic, strong) UIImage *disableSelectImage;

@property (nonatomic, assign) BOOL isStyleNew;

@property (nonatomic, assign) BOOL selected;

@property (nonatomic, assign) BOOL isEnabled;

@property (nonatomic, strong) CSSelectableModel *model;

/**
 * 加载textfield
 */
+(void)loadImageWithType:(CSRadioViewType)key value:(UIImage *)image;

+(instancetype)radio_ItemView:(NSString *)title cellheight:(CGFloat)cellHeight;

+(instancetype)radio_ItemViewWithModel:(CSSelectableModel *)model cellheight:(CGFloat)cellHeight;

@end

@interface CS_Page_RadioView : CSBaseView

@property (nonatomic, strong) NSMutableArray *radioSelectableModels;

@property (nonatomic, assign) NSInteger selectedIndex;

/**
 * 是否需要分割线
 */
@property (nonatomic, assign) BOOL isSeperatorLineRequired;

/**
 * 多选使能
 */
@property (nonatomic, assign) BOOL isMulityEnable;

/**
 *  左侧标题对齐方式
 */
@property (nonatomic, assign) NSTextAlignment textAlignment;


+(instancetype)pageRadioViewWithNoDefaultSelected:(NSString *)title items:(NSArray *)array selectedHandler:(RadioButtonClick)selectHandler;

+(instancetype)pageRadioView:(NSString *)title items:(NSArray *)array selectedHandler:(RadioButtonClick)selectHandler;

+(instancetype)pageRadioView:(NSString *)title items:(NSArray *)array selectableHandler:(RadioSelectableButtonClick)selectableHandler;

/**
 * 重新设置大小
 */
-(void)reSizeView;

@end
